package com.ruoyi.consumer.controller

import com.ruoyi.common.core.web.controller.BaseController
import com.ruoyi.consumer.domain.PostTest
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController

/**
 *@author YanYu
 *@date 2024/11/24 14:18
 */
@RestController
@RequestMapping("/jm-test")
class JmeterController: BaseController() {

    @GetMapping("/get-test")
    fun getTest(@RequestParam name: String,@RequestParam age: Int): String {
        return "姓名: $name,年龄: $age"
    }

    @PostMapping("/post-test")
    fun postTest(@RequestBody body: PostTest): String {
        return "姓名: ${body.name},年龄: ${body.age}"
    }
}